{include app:admin.inc.header}
<!--tmpl-resource-->
{include app:admin.inc.top}


<div class="container-fluid content-body">
	<div class="main">
		<!-- left side start-->

		<section class="left-section">
			<dl id="leftNav" data-type="system">
				<dt><i class="glyphicon glyphicon-plus"></i> 系统管理</dt>
				{if (in_case_array('admin/node',$priv) || empty($priv)) && $appConfigs['originator_id'] == adminId()}
				<dd><a class="mb active" href="{url /admin/node/index}">权限列表</a></dd>
				{/if}
				{if in_case_array('admin/role',$priv) || empty($priv)}
				<dd><a class="mbh" href="{url /admin/role/index}">角色列表</a></dd>
				{/if}
				{if in_case_array('admin/manager',$priv) || empty($priv)}
				<dd><a class="mbh" href="{url /admin/manager/index}">管理员列表</a></dd>
				{/if}
			</dl>
		</section>

		<!-- left side end-->


		<!-- main content start-->
		<section class="right-section" id="right-section">
			<!-- start of inner-frame -->
			<div class="inner-iframe">

				<!-- page breadcrumb start-->
				{include admin.inc.bread}
				<!-- page "breadcrumb end-->
				<!-- Nav tabs -->
				<ul class="nav nav-tabs">

					<li {if $id==''}class="active"{/if}><a {if $id==''}href="javascript:void(0);"{else}href="{$add_url}"{/if}><i class="glyphicon glyphicon-plus"></i> 添加权限</a></li>
					<li><a href="{$index_url}" ><i class="glyphicon glyphicon-th-list"></i> 权限列表</a></li>
					{if $id != ''}<li class="active"><a href="javascript:void(0);"><i class="glyphicon glyphicon-edit"></i> 编辑权限</a></li>{/if}

				</ul>
				<div class="inner-container">
					<form role="form" class="content-add-form" id="content-add-form" autocomplete="off">

						<!--tmpl-fields-->

						<!-- input -->
						<div class="form-group">
							<label >
								<span class="asterisk">*</span>
								权限名称
							</label>
							<input  dtype="" class="form-control" maxlength="50" name="data[name]" placeholder="" required cname="" value="{$item[name]}" />
						</div>
						<p class="help-block"></p>
						
						<!-- input -->
						<div class="form-group">
							<label > 权限标识</label>
							<input  dtype="" class="form-control" maxlength="50" name="data[node_key]" placeholder="" required cname="" value="{$item[node_key]}" />
						</div>
						<p class="help-block"></p>
						
						<!-- textarea -->
						<div class="form-group">
							<label>
								<span class="asterisk">*</span>
								备注
							</label>
							<textarea class="form-control" maxlength="255" name="data[remark]" placeholder="" required cname="">{$item[remark]}</textarea>
						</div>
						<p class="help-block"></p>

						<div class="btn-group btn-group-or">
							<a href="{if $id==''}{$do_add_url}{else}{$do_edit_url}?id={$id}{/if}" class="btn btn-primary ajaxproxy"
								proxy='{"method":"post", "location":"{$index_url}"}'>提交保存</a>

						</div>
					</form><!-- content add form -->
				</div>
			</div><!-- end of inner -->
		</section>
	</div>
</div>
{include admin.inc.footer}

<!--tmpl-script-->

<!-- assocalert -->
<script id="admin_role-assoc-box" type="text/html">
<div class="assoc-alertbox">
	<div class="searchbar">
		<form class="assoc-foreign-form form-inline">
			<!--tmpl-search-->

			<!-- searchinput -->
			<div class="form-group">
				<div class="input-group">
					<div class="input-group-addon">
						
					</div>
					<input type="text" class="form-control input-sm" maxlength="50" placeholder="" name="s_name" value="{$s_name}">
				</div>
			</div>

			<input type="hidden" name="order" value="{$order}">
			<input type="btn" class="btn btn-sm btn-success assoc-search-btn" value="搜索"/>
		</form>
	</div>
	<div class="content">
	
	</div>
	<div class="paginate">

	</div>
</div>
</script>

<!-- assoclist -->
<script id="admin_role-assoc-tablelist" type="text/html">
<table class="table  table-condense">
	<tr>
		<th><input type="checkbox" id="assoc-selectall" ></th>
		<!--tmpl-th-->

		<th></th>
		<th></th>
		<th></th>
		<th></th>
		<th></th>
		<th></th>
		<th></th>
		<th>AppId</th>

	</tr>
	{[loop items item]}
	<tr>
		<td><input type="checkbox" name="assoc[]" value="{[item.id]}"></td>
		<!--tmpl-td-->

		<td>{[item.name]}</td>
		<td>{[item.role_key]}</td>
		<td>{[item.remark]}</td>
		<td>{[item.addtime]}</td>
		<td>{[item.edittime]}</td>
		<td>{[item.admin_manager_id]}</td>
		<td>{[item.del_status]}</td>
		<td>{[item.app_id]}</td>


	</tr>
	{[/loop]}
</table>
</script>



<!-- pagescript -->
<script type="text/javascript">
	seajs.use("admin/admin_nodeadd",function (parameter){
		
		/**--tmpl-templatejavascript--**/
		
		<!--tmpl-templatejavascript-->

		parameter.admin_role_assoc_url="{$admin_role_assoc_url}";

		parameter.upload_url="{$upload_url}";
		parameter.image_search_url="{$image_search_url}";
		parameter.image_list_url="{$image_list_url}";
		
		parameter.init();		
	});
</script>


<script id="assocpage" type="text/html">
<div class="text-right">
	<ul class="pagination blog-pagination">
		<li><a class="assoc-page" data-page="{[prev]}" href="javascript:void(0);">上一页</a></li> 
		{[loop pages page]}

		<li ><a class="assoc-page" data-page="{[page]}" {[if curr == page]}class="active"{[/if]} href="javascript:void(0)">{[page]}</a></li> 

		{[/loop]}
		<li><a class="assoc-page" href="javascript:void(0);" data-page="{[nexts]}">下一页</a></li> 
	</ul>	
</div>
</script>

</body>
</html>
